<?
/*
 Plugin Name: Views Counter
 Plugin URI: http://blog.cerebrate.ru/vc
 Description: VC counts simple statistics on views and unique visitors per every post.
 Version: 1.0β
 Author: cryonyx
 Author URI: http://blog.cerebrate.ru

 Copyright 2006 cryonyx (e-mail: cryonyx@cerebrate.ru)

 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

error_reporting(E_ALL);

$local_path	=	dirname(__FILE__) . '/';
require_once($local_path . 'core/vc.core.php');
require_once($local_path . 'vc.wp.options.php');
require_once($local_path . 'vc.wp.db.php');
include_once($local_path . 'vc.init.php');

$VCDB	=	new VC_DB_WP(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
$VCDB->set_prefix($wpdb->prefix);
$VCO	=	new VC_Options_WP($VCDB);

//	Load options
$res	=	$VCO->fetch();
if($res) {
	trigger_error('VC: options loaded. Continue to installation;');
	add_action('activate_vc/vc.wp.php', 'vc_install');

	//	Checking if the database is already migrated
	/*if(!$_SESSION['vc']['migrated']) {
		$VCDB->migrate_database();
	}*/
}

?>